<?php
 $selected_cat = set_value('category');
 $selected_cat_setting = array(
    'table_name' => 'link_category',
    'key_field' => 'id',
    'value_field' => 'name'
);
?>
<div id="content">
    <?php if ($this->session->flashdata('error')): ?>
        <div class="affiche_erreur">
        <?php echo $this->session->flashdata('error'); ?>
    	</div>
    <?php endif; ?>
    
    <?php if (isset($add_error) && ($add_error != null)): ?>
        <div class="affiche_erreur">
        <?php echo $add_error; ?>
    	</div>
    <?php endif; ?>
   
   <div id="title_content"><?php echo lang('add')." event schedule" ?></div>
    <?php echo form_open_multipart('admin_link/add_event_schedule'); ?>
        <table class="form_content" width="100%">
        <tr>
             <td>Link <span style="color:red">*</span></td>
            <td>
                <?php if (form_error('link') != "") {
                ?> <div class="form_error"><?php echo generate_pure_text(form_error('link'), '<p>', '</p>'); ?></div> <?php } ?>
                <input type="text" class="form_input" name="link" size="35" maxlength="40" value="<?php echo set_value('link'); ?>" /></td>
        </tr>
        
         <tr>
             <td><?php echo lang('title');?> <span style="color:red">*</span></td>
            <td>
                <?php if (form_error('title') != "") {
                ?> <div class="form_error"><?php echo generate_pure_text(form_error('title'), '<p>', '</p>'); ?></div> <?php } ?>
                <input type="text" class="form_input" name="title" size="35" maxlength="40" value="<?php echo set_value('title'); ?>" /></td>
        </tr>
        
        <tr>
                 <td>Image <span style="color:red"></span></td>
           <td> 
           <?php if (form_error('userfile')!=""){?> <div class="form_error"><?php echo generate_pure_text(form_error('userfile'), '<p>', '</p>'); ?></div> <?php } ?>
           <input type="file"  name="userfile" size="30" />
           </td>
       </tr>
        <tr>
             <td><?php echo "Category";?> <span style="color:red"></span></td>
            <td>
                <?php if (form_error('category') != "") {
                ?> <div class="form_error"><?php echo generate_pure_text(form_error('category'), '<p>', '</p>'); ?></div> <?php } ?>
                <?php echo form_dropdown('category', dropdown_data($selected_cat_setting), $selected_cat) ?>
        </tr>
       
             
        <tr>
            <td colspan="2"><input type="submit" name="add_event_schedule" value="<?php echo lang('add')?>" class="form_submit" /></td>
        </tr>
    </table>
    <?php echo form_close(); ?>
</div>